<template>
    <div class="app-container">
        <interface-data-view :id="id" :code="code" :codeEditable="false"></interface-data-view>
    </div>
</template>

<script>
import InterfaceDataView from './components/InterfaceDataView.vue'

export default {
    name:'InterfaceView',
    components: {
        InterfaceDataView
    },
    data(){
        return {
            id: this.$route.params.id,
            code: this.$route.query.code
        }
    },
    beforeRouteEnter(to, from, next) {
        // 修改路由元信息，不同路由使用同一个组件显示不同的tag名称
        if (to.query.name) {
            to.meta.title = "查看接口-" + to.query.name
            // console.log("tag name", to.meta.title)
        }
        next()
    },
}
</script>

<style></style>